<head th:fragment="header">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="description" content="">
    <meta name="keywords" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>MY LIFE</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <link rel="icon" type="image/png" th:href="@{/myfile/assets/i/favicon.png}">
    <meta name="mobile-web-app-capable" content="yes">
    <link rel="icon" sizes="192x192" th:href="@{/myfile/assets/i/app-icon72x72@2x.png}">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-title" content="Amaze UI"/>
    <link rel="apple-touch-icon-precomposed" th:href="@{/myfile/assets/i/app-icon72x72@2x.png}">
    <meta name="msapplication-TileImage" th:href="@{/myfile/assets/i/app-icon72x72@2x.png}">
    <meta name="msapplication-TileColor" content="#0e90d2">


    <link th:href="@{/myfile/layui/css/layui.css}" rel="stylesheet"/>
    <link rel="stylesheet" th:href="@{/myfile/assets/css/amazeui.min.css}">
    <link rel="stylesheet" th:href="@{/myfile/assets/css/app.css}">


</head>


<div th:fragment="top">

    <div class="am-g am-g-fixed blog-fixed blog-text-center blog-header">
        <div class="am-u-sm-8 am-u-sm-centered">
            <img width="200" src="/myfile/images/logo.jpg" alt="Amaze UI Logo"/>
            <h2 class="am-hide-sm-only">WelCome<span style="color: #ea7616">(VIP)</span>:<span th:text="${userInfo.userName}"></span>&nbsp;<a href="/logout" style="color: #6bcd1f">⭕</a></h2>
        </div>
        <input type="hidden" id="userName" th:value="${userInfo.userName}">
    </div>
</div>


<div th:fragment="footer">

    <footer class="blog-footer">
        <div class="am-g am-g-fixed blog-fixed am-u-sm-centered blog-footer-padding">
            <div class="am-u-sm-12 am-u-md-4- am-u-lg-4">
                <h3>模板简介</h3>
                <p class="am-text-sm">这是一个使用amazeUI做的简单的前端模板。<br> 博客/ 资讯类 前端模板 <br> 支持响应式，多种布局，包括主页、文章页、媒体页、分类页等<br>嗯嗯嗯，不知道说啥了。外面的世界真精彩<br><br>
                    Amaze UI 使用 MIT 许可证发布，用户可以自由使用、复制、修改、合并、出版发行、散布、再授权及贩售 Amaze UI 及其副本。</p>
            </div>
            <div class="am-u-sm-12 am-u-md-4- am-u-lg-4">
                <h3>社交账号</h3>
                <p>
                    <a href=""><span class="am-icon-qq am-icon-fw am-primary blog-icon blog-icon"></span></a>
                    <a href=""><span class="am-icon-github am-icon-fw blog-icon blog-icon"></span></a>
                    <a href=""><span class="am-icon-weibo am-icon-fw blog-icon blog-icon"></span></a>
                    <a href=""><span class="am-icon-reddit am-icon-fw blog-icon blog-icon"></span></a>
                    <a href=""><span class="am-icon-weixin am-icon-fw blog-icon blog-icon"></span></a>
                </p>
                <h3>Credits</h3>
                <p>我们追求卓越，然时间、经验、能力有限。Amaze UI 有很多不足的地方，希望大家包容、不吝赐教，给我们提意见、建议。感谢你们！</p>
            </div>

        </div>
        <div class="blog-text-center">© 2015 AllMobilize, Inc. Licensed under MIT license. Made with love By LWXYFER
        </div>
    </footer>


    <script th:src="@{/myfile/js/common.js}"></script>
    <script th:src="@{/myfile/layui/layui.all.js}"></script>
    <script th:src="@{/myfile/js/jquery.min.js}"></script>

    <!--[if (gte IE 9)|!(IE)]><!-->
    <script th:src="@{/myfile/assets/js/jquery.min.js}"></script>
    <!--<![endif]-->
    <!--[if lte IE 8 ]>
    <script src="http://libs.baidu.com/jquery/1.11.3/jquery.min.js"></script>
    <script src="http://cdn.staticfile.org/modernizr/2.8.3/modernizr.js"></script>
    <script th:src="@{/assets/js/amazeui.ie8polyfill.min.js}"></script>
    <![endif]-->
    <script th:src="@{/myfile/assets/js/amazeui.min.js}"></script>

</div>

<div th:fragment="socket">
    <script type="text/javascript">
        var ws = null;
        var username = $("#userName").val();

        $(function () {
            if(username!=null){
                $("#content").html('');
                if ('WebSocket' in window){
                    //ws = new WebSocket("ws://www.niezhiliang.com:8086/socketServer/"+$("#username").val());
                    ws = new WebSocket("ws://"+window.location.host+"/socketServer/"+$("#userName").val());
                }
                else if ('MozWebSocket' in window){
                    //ws = new MozWebSocket("ws://www.niezhiliang.com:8086/socketServer/"+$("#username").val());
                    ws = new MozWebSocket("ws://"+window.location.host+"/socketServer/"+$("#userName").val());
                }
                else{
                    alert("该浏览器不支持websocket");
                }


                ws.onmessage = function(evt) {


                    layer.open({
                        type: 1,
                        time: 5000
                        ,title: false //不显示标题栏
                        ,closeBtn: false
                        ,area: '300px;'
                        ,shade: 0
                        ,id: 'LAY_layuipro' //设定一个id，防止重复弹出
                        ,btn: ['YES', 'NO']
                        ,btnAlign: 'c'
                        ,anim: 2
                        ,offset: 'auto'
                        ,moveType: 1 //拖拽模式，0或者1
                        ,content: '<div style="padding: 5px; line-height: 22px; background-color: #393D49; color: #ffcaff; font-weight: 100;"><img width="100%" height="450px" src="' +JSON.parse(evt.data).imgUrl+'"></div>'
                        ,success: function(layero){
                            var btn = layero.find('.layui-layer-btn');
                            btn.find('.layui-layer-btn0').attr({

                                href: '/photo/fuliPhotosDetail?parentId='+JSON.parse(evt.data).parentId
                                ,target: '_blank'
                            });
                        }
                    });

                };

                ws.onclose = function(evt) {

                };

                ws.onopen = function(evt) {

                };
            }else{
                alert("请输入您的昵称");
            }
        })



        function sendMsg() {
            ws.send($("#writeMsg").val());
        }
    </script>
</div>

<div th:fragment="navTop">

    <div class="am-collapse am-topbar-collapse" id="blog-collapse">
        <ul class="am-nav am-nav-pills am-topbar-nav">
            <li class="tab"><a href="/photo/userPhotoList">HOME</a></li>
            <!--<li class="tab"><a href="/photo/imgs">图片库</a></li>-->
            <!--<li class="tab"><a href="/index/addPhoto">图片上传</a></li>-->
            <li class="tab"><a href="/photo/fuliPhotos?imgType=100">FASHTION</a></li>
            <li class="tab"><a href="/photo/fuliPhotos?imgType=200">COSPLAY</a></li>
            <li class="tab"><a href="/photo/fuliPhotos?imgType=300">STUDENT</a></li>
            <li class="tab"><a href="/photo/fuliPhotos?imgType=400">YOU KNOW</a></li>
            <li class="tab"><a href="/photo/fuliPhotosDetail?parentId=000">OTHER</a></li>
        </ul>
        <form class="am-topbar-form am-topbar-right am-form-inline" role="search">
            <div class="am-form-group">
                <input type="text" class="am-form-field am-input-sm" placeholder="search">
            </div>
        </form>
    </div>


</div>
